home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / bbs / rfc / rfcxxxx_8.lha / rfc1741 < prev    next >
Text File  |  1995-07-26  |  10KB  |  340 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                       P. Faltstrom
  8. Request for Comments: 1741                 Royal Institute of Technology
  9. Category: Informational                                       D. Crocker
  10.                                                   Brandenburg Consulting
  11.                                                                  E. Fair
  12.                                                      Apple Computer Inc.
  13.                                                            December 1994
  14.  
  15.  
  16.                MIME Content Type for BinHex Encoded Files
  17.  
  18. Status of this Memo
  19.  
  20.    This memo provides information for the Internet community.  This memo
  21.    does not specify an Internet standard of any kind.  Distribution of
  22.    this memo is unlimited.
  23.  
  24. Abstract
  25.  
  26.    This memo describes the format to use when sending BinHex4.0 files
  27.    via MIME [BORE93].  The format is compatible with existing mechanisms
  28.    for distributing Macintosh files.  Only when available software
  29.    and/or user practice dictates, should this method be employed.  It is
  30.    recommended to use application/applefile [FALT94] for maximum
  31.    interoperability.
  32.  
  33. 1.  Introduction
  34.  
  35.    Files on the Macintosh consists of two parts, called forks:
  36.  
  37.    DATA FORK:       The actual data included in the file.  The Data
  38.                     fork is typically the only meaningful part of a
  39.                     Macintosh file on a non-Macintosh computer system.
  40.                     For example, if a Macintosh user wants to send a
  41.                     file of data to a user on an IBM-PC, she would only
  42.                     send the Data fork.
  43.  
  44.    RESOURCE FORK:   Contains a collection of arbitrary attribute/value
  45.                     pairs, including program segments, icon bitmaps,
  46.                     and parametric values.
  47.  
  48.    Additional information regarding Macintosh files is stored by the
  49.    Finder has in a hidden file, called the "Desktop Database".
  50.  
  51.    Because of the complications in storing different parts of a
  52.    Macintosh file in a non-Macintosh filesystem that only handles
  53.    consecutive data in one part, it is common to convert the Macintosh
  54.    file into some other format before transferring it over the network.
  55.  
  56.  
  57.  
  58. Faltstrom, Crocker & Fair                                       [Page 1]
  59.  
  60. RFC 1741             Content Type for BinHex Files         December 1994
  61.  
  62.  
  63.    AppleDouble file format [APPL90], encoded in MIME as
  64.    multipart/appledouble [FALT94] and application/applefile [FALT94] is
  65.    the preferred format for a Macintosh file that is to be included in
  66.    an Internet mail message, because it provides recipients with
  67.    Macintosh computers the entire document, including Icons and other
  68.    Macintosh specific information, while other users easily can extract
  69.    the Data fork (the actual data).
  70.  
  71.    However, this specification provides for use of the currently popular
  72.    BinHex4.0 encoding schemes, as a convinience to the installed base of
  73.    users.
  74.  
  75. 2.  MIME format for BinHex4.0
  76.  
  77.    MIME-base Apple information is specified by:
  78.  
  79.    MIME type-name:            APPLICATION
  80.    MIME subtype name:         MAC-BINHEX40
  81.    Required parameters:       none
  82.    Optional parameters:       NAME, which must be a "value" as
  83.                               defined in RFC-1521 [BORE93].
  84.    Encoding considerations:   none
  85.    Security considerations:   See separate section in the document
  86.    Published specification:   Appendix A
  87.    Rationale:                 Permits MIME-based transmission of data
  88.                               with Apple Macintosh file system specific
  89.                               information using a currently popular,
  90.                               though platform specific, format.
  91.  
  92.    2a.  Detail specific to MIME-based usage
  93.  
  94.       Macintosh documents do not always need to be sent in a special
  95.       format.  Those documents with well-known MIME types and non-
  96.       existent or trivial resource forks can be sent as regular MIME
  97.       body parts, without use of AppleSingle, AppleDouble or BinHex4.0.
  98.  
  99.       Documents which lack a data fork must be sent as AppleSingle
  100.       according to RFC 1740 [FALT94].
  101.  
  102.       Unless there are strong reasons not to, all other documents should
  103.       be sent as AppleDouble according to RFC 1740 [FALT94].  This
  104.       includes documents with non-trivial resource forks, and documents
  105.       without corresponding well-known MIME types.
  106.  
  107.       It may be valuable in some cases to allow the user to choose one
  108.       format over another, either because he disagrees with the
  109.       implementor's definition of "trivial" resource forks, or for
  110.       reasons of his own.
  111.  
  112.  
  113.  
  114. Faltstrom, Crocker & Fair                                       [Page 2]
  115.  
  116. RFC 1741             Content Type for BinHex Files         December 1994
  117.  
  118.  
  119.       Only when available software and/or user practice dictates, should
  120.       BinHex 4.0 be employed.
  121.  
  122. 3.  BinHex
  123.  
  124.    BinHex 4.0 is a propular means of encoding Macintosh files for
  125.    archiving on non-Macintosh file systems and for transmission via
  126.    Internet mail.  (See Appendix A for a brief description of the BinHex
  127.    4.0 format.)
  128.  
  129.    The content-type application/mac-binhex40 indicates that the body of
  130.    the mail is a BinHex4.0 file.  Even though the BinHex encoding
  131.    consists of characters which are not the same as those used in Base64
  132.    (those regarded as safe according to RFC-1521 [BORE93]) a
  133.    transportation encoding should not be done.
  134.  
  135.    Even though a BinHex file includes the original Macintosh filename,
  136.    it is recommended that a name parameter be included on the Content-
  137.    Type header to give the recipient a hint as to what file is attached.
  138.    The value of the name parameter must be a "value" as defined by RFC-
  139.    1521 [BORE93].  Note that this restricts the value to seven-bit US-
  140.    ASCII characters.
  141.  
  142.    3a.  BinHex example
  143.  
  144.         Content-Type: application/mac-binhex40; name="car.hqx"
  145.  
  146.             [The BinHex4.0 file goes here]
  147.  
  148. 4.  References
  149.  
  150.    APPL90   AppleSingle/AppleDouble Formats for Foreign Files
  151.             Developer's Note, Apple Computer, Inc., 1990.
  152.  
  153.    FALT94   Faltstrom P., Crocker, D., and E. Fair, "MIME
  154.             Encapsulation of Macintosh Files - MacMIME", RFC 1740,
  155.             KTH, Brandenburg Consulting, Apple Computer Inc.,
  156.             December 1994.
  157.  
  158.    BORE93   Borenstein N., and N. Freed, "MIME (Multipurpose Internet
  159.             Mail Extensions): Mechanisms for Specifying and Describing
  160.             the Format of Internet Message Bodies", RFC 1521, Bellcore,
  161.             Innosoft, September 1993.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Faltstrom, Crocker & Fair                                       [Page 3]
  171.  
  172. RFC 1741             Content Type for BinHex Files         December 1994
  173.  
  174.  
  175. 5.  Security Considerations
  176.  
  177.    To the extent that application/mac-binhex40 facilitates the
  178.    transmission of operating-system sensitive data, it may open a door
  179.    for easier relaxation of security rules than is intended either by
  180.    the sender of the administrator of the sender's system.
  181.  
  182. 6.  Acknowledgements
  183.  
  184.    Thanks to all of the people on the ietf-822 list who have provided
  185.    much meaningful input for this document.  Some of them must though be
  186.    remembered by name, because they have almost crushed my mailbox the
  187.    last weeks with a very nice and interesting debate:
  188.  
  189.       Johan Berglund, Steve Dorner, David Gelhar, David Herron, Raymond
  190.       Lau, Jamey Maze, John B. Melby, Jan Michael Rynning, Rens Troost,
  191.       and Peter Svanberg.
  192.  
  193. 7.  Authors' Addresses
  194.  
  195.       Patrik Faltstrom
  196.       Department of Numerical Analysis and Computing Science
  197.       Royal Institute of Technology
  198.       S-100 44 Stockholm
  199.       Sweden
  200.  
  201.       EMail: paf@nada.kth.se
  202.  
  203.  
  204.       Dave Crocker
  205.       Brandenburg Consulting
  206.       675 Spruce Dr.
  207.       Sunnyvale, CA  94086
  208.  
  209.       EMail: dcrocker@mordor.stanford.edu
  210.  
  211.  
  212.       Erik E. Fair
  213.       Engineering Computer Operations
  214.       Apple Computer Inc.
  215.  
  216.       EMail: fair@apple.com
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Faltstrom, Crocker & Fair                                       [Page 4]
  227.  
  228. RFC 1741             Content Type for BinHex Files         December 1994
  229.  
  230.  
  231. Appendix A.  The BinHex format
  232.  
  233.    Here is a description of the Hqx7 (7 bit format as implemented in
  234.    BinHex 4.0) formats for Macintosh Application and File transfers.
  235.  
  236.    The main features of the format are:
  237.  
  238.    1) Error checking even using ASCII download
  239.    2) Compression of repetitive characters
  240.    3) 7 bit encoding for ASCII download
  241.  
  242.    The format is processed at three different levels:
  243.  
  244.       1) 8 bit encoding of the file:
  245.  
  246.    Byte:    Length of FileName (1->63)
  247.    Bytes:   FileName ("Length" bytes)
  248.    Byte:    Version
  249.    Long:    Type
  250.    Long:    Creator
  251.    Word:    Flags (And $F800)
  252.    Long:    Length of Data Fork
  253.    Long:    Length of Resource Fork
  254.    Word:    CRC
  255.    Bytes:   Data Fork ("Data Length" bytes)
  256.    Word:    CRC
  257.    Bytes:   Resource Fork ("Rsrc Length" bytes)
  258.    Word:    CRC
  259.  
  260.  
  261.       2) Compression of repetitive characters.
  262.  
  263.    ($90 is the marker, encoding is made for 3->255 characters)
  264.  
  265.    00 11 22 33 44 55 66 77   -> 00 11 22 33 44 55 66 77
  266.    11 22 22 22 22 22 22 33   -> 11 22 90 06 33
  267.    11 22 90 33 44            -> 11 22 90 00 33 44
  268.  
  269.    The whole file is considered as a stream of bits.  This stream will
  270.    be divided in blocks of 6 bits and then converted to one of 64
  271.    characters contained in a table.  The characters in this table have
  272.    been chosen for maximum noise protection.  The format will start
  273.    with a ":" (first character on a line) and end with a ":".
  274.    There will be a maximum of 64 characters on a line.  It must be
  275.    preceded, by this comment, starting in column 1 (it does not start
  276.    in column 1 in this document):
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Faltstrom, Crocker & Fair                                       [Page 5]
  283.  
  284. RFC 1741             Content Type for BinHex Files         December 1994
  285.  
  286.  
  287.     (This file must be converted with BinHex 4.0)
  288.  
  289.    Any text before this comment is to be ignored.
  290.  
  291.    The characters used is:
  292.  
  293.     !"#$%&'()*+,- 012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Faltstrom, Crocker & Fair                                       [Page 6]
  339.  
  340.